/*
 * @Author: chenzanjing
 * @Date: 2023-09-25 11:20:52
 * @LastEditors: chenzanjing
 * @LastEditTime: 2023-11-02 10:56:25
 * @FilePath: \zhiji-manage-front\src\api\modules\user.ts
 * @Description:
 *
 * Copyright (c) 2023 by ${sylar}, All Rights Reserved.
 */
import { ResPage, User as IUser } from "@/api/interface/index";
import { AUTH } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 用户管理模块
 */

// 用户绑定手机
export default class User {
  /* 用户列表 */
  getUserList(params) {
    return http.get<ResPage<IUser.ResUserList>>("/user/list", params);
  }
  /**
   * 获取用户部门树
   * @param params
   * @returns
   */
  getUserDeptTree(params?) {
    return http.get("/user/deptTree", params);
  }
  /**获取用户岗位和角色*/
  getUserPostAndRole() {
    return http.get("/user/");
  }
  /**创建用户 */
  addUser(data) {
    return http.post("/user", data);
  }
  /**更新用户 */
  putUser(data) {
    return http.put("/user", data);
  }
  /**删除用户 */
  deleteUser(id) {
    return http.delete(`/user/${id}`);
  }
  /**导入 */
  importUser(data) {
    return http.post("/user/importTemplate", data);
  }
  /**根据用户id获取详情 */
  getUserDetail(id) {
    return http.get(`/user/${id}`);
  }
  /**更新用户密码 */
  restUserPwd(data) {
    return http.put(`user/resetPwd`, data);
  }
}
